<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>{% block title %}{% endblock %} - {{ data.site.SiteName }} - 管理后台</title>
    {% include "../common/_app_css.html" %}
    {% block head %}{% endblock %}
    {% block importCss %}{% endblock %}
    <style id="layuimini-bg-color"></style>
    {% block style %}{% endblock %}
</head>
<body class="layui-layout-body layuimini-all">
<div class="layadmin-tabspage-none">

    <div class="layui-layout layui-layout-admin">
        {% include "_header.html" %}

        {% include "_sidebar.html" %}

        <div class="layui-body">
            <div class="layuimini-tab layui-tab-rollTool layui-tab" lay-filter="layuiminiTab" lay-allowclose="true">
                <ul class="layui-tab-title">
                    <li class="layui-this" id="layuiminiHomeTabId" lay-id=""></li>
                </ul>
                <div class="layui-tab-control">
                    <li class="layuimini-tab-roll-left layui-icon layui-icon-left"></li>
                    <li class="layuimini-tab-roll-right layui-icon layui-icon-right"></li>
                    <li class="layui-tab-tool layui-icon layui-icon-down">
                        <ul class="layui-nav close-box">
                            <li class="layui-nav-item">
                                <a href="javascript:;"><span class="layui-nav-more"></span></a>
                                <dl class="layui-nav-child">
                                    <dd>
                                        <a href="javascript:;" layuimini-tab-close="current">关闭当前</a>
                                    </dd>
                                    <dd>
                                        <a href="javascript:;" layuimini-tab-close="other">关闭其他</a>
                                    </dd>
                                    <dd>
                                        <a href="javascript:;" layuimini-tab-close="all">关闭全部</a>
                                    </dd>
                                </dl>
                            </li>
                        </ul>
                    </li>
                </div>
                <div class="layui-tab-content">
                    <div id="layuiminiHomeTabIframe" class="layui-tab-item layui-show"></div>
                </div>
            </div>
        </div>

        <div class="layui-body" style="display:none;">
            <div class="layadmin-tabsbody-item layui-show">

                <div class="layui-card layadmin-header">
                    <div class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
                        123213
                    </div>
                </div>

                <div class="layui-fluid">
                    {% block content %}{% endblock %}
                </div>
            </div>
        </div>


        <!-- 辅助元素，一般用于移动设备下遮罩 -->
        <div class="layadmin-body-shade" layadmin-event="shade"></div>

        <!--初始化加载层-->
        <div class="layuimini-loader">
            <div class="layuimini-loader-inner"></div>
        </div>

        <!--手机端遮罩层-->
        <div class="layuimini-make"></div>

        <!-- 移动导航 -->
        <div class="layuimini-site-mobile"><i class="layui-icon"></i></div>

    </div>

</div>
{% block footer %}{% endblock %}
{% block script %}{% endblock %}
{% include "../common/_app_js.html" %}
<script>
    layui.use(['jquery', 'layer', 'miniAdmin','miniTongji'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            miniAdmin = layui.miniAdmin

        var MasterPage = {
            data: {
                user: {}
            },
            init: function() {
                this.info()
                this.render()
                this.bind()
            },
            info: function () {
                var user = JSON.parse(app.atob(localStorage.getItem('milu.article.user')))

                if (user) {
                    $('#js-top-username').text(user.nickname)
                    this.data.user = user
                }
            },
            bind: function() {
                $('.login-out').on("click", function () {
                    layer.msg('成功退出', { time: 1200 }, function () {
                        window.location.href = '/admin/login'
                        app.cookie.remove('milu.article.token')
                    });
                });
            },
            render: function () {
                var options = {
                    // iniUrl: '/public/common/api/init.json',    // 初始化接口
                    iniUrl: '/admin/mini',    // 初始化接口
                    clearUrl: '/public/common/api/clear.json', // 缓存清理接口
                    urlHashLocation: true,      // 是否打开hash定位
                    bgColorDefault: false,      // 主题默认配置
                    multiModule: true,          // 是否开启多模块
                    menuChildOpen: false,       // 是否默认展开菜单
                    loadingTime: 0,             // 初始化加载时间
                    pageAnim: true,             // iframe窗口动画
                    maxTabNum: 20,              // 最大的tab打开数量
                }
                miniAdmin.render(options);
            },
        }

        MasterPage.init()
    });

    $(function () {
        app.admin.init()
    });
</script>
<script>
    {% block scriptVar %}
    {% endblock %}
</script>
</body>
</html>